package com.xyzboom.database.utils;

public class SQLLimit {
    private final Integer pageIndex;
    private final Integer pageSize;

    public SQLLimit(int pageIndex, int pageSize) {
        this.pageIndex = pageIndex;
        this.pageSize = pageSize;
    }

    public SQLLimit(Integer pageSize) {
        pageIndex = 0;
        this.pageSize = pageSize;
    }

    public String getSqlStr() {
        return " limit " + (pageIndex * pageSize) + ", " + (pageSize) + " ";
    }
}
